﻿<!DOCTYPE html>
<!--受限空间作业安全许可证审批-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="../../static/js/Mock/JobLicenseApp_wanglr.js"></script>
    <script src="../../static/js/Resource/JobLicenseApp_wanglr.js"></script>
    <style>
        body {
            padding-bottom: 10px;
        }

        .toptitle label {
            margin-left: 20px;
        }

        .align_left {
            text-align: left;
        }

        table {
            width: 100%;
            border-top: 1px solid;
            border-left: 1px solid;
            text-align: center;
            /*border-right: none;*/
        }

            table td {
                border-right: 1px solid;
                border-bottom: 1px solid;
                height:19px;
                padding: 10px;
            }

        .floatDiv {
            position: fixed;
            top: 10%;
            left: 1px;
            border: 1px solid #ccc;
            background: #EBEEF5;
            cursor: pointer;
            width: 14px;
            font-size: 14px;
            padding: 10px;
        }

        .divTableBox {
            float: left;
            height: 50%;
            box-sizing: border-box;
            text-align: center;
            font-size: 14px;
        }

            .divTableBox ul {
                list-style: none;
                padding: 0;
                margin: 0;
                float: left;
                width: 100%;
                border-right: 1px solid;
            }

                .divTableBox ul li {
                    list-style: none;
                    padding: 0;
                    margin: 0;
                    float: left;
                    width: 20%;
                    height: 40px;
                    line-height: 40px;
                    font-size: 14px;
                    text-align: center;
                    box-sizing: border-box;
                    /* border-right: 1px solid; */
                    border-bottom: 1px solid;
                }

        /*.divTableBox ul :nth-child(2n) {
                background: green;
            }

            .divTableBox ul :nth-child(2n+1) {
                background: red;
            }*/
    </style>

</head>
<body>
    
<div id="app" v-cloak>   
        <div @click="DialogInput" class="floatDiv">
            相关表格
        </div>
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">受限空间作业安全许可证</label>
        </div>
        <div style="width:100%;text-align:right" class="toptitle">
            <label>2018-09-09</label>
            <label>Q/G11-018-R01</label>
            <label>No.：{{id}}</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" :rules="rules" ref="ruleForm">
            <table cellpadding="0" cellspacing="0" style="">
                <tr>
                    <td width="10%" rowspan="6">{{SecurityAndRiskConfirmationCard.JobContent}}</td>
                    <td width="15%">{{ConfinedSpace.BelongUnit}}</td>
                    <td width="25%" colspan="2">{{Form.BelongUnit}}</td>
                    <td width="30%" colspan="2">{{WireRopeAndHookCheck.WorkingArea+mark.m}}{{Form.WorkingArea}}</td>
                    <td width="10%" rowspan="2">{{ConfinedSpace.RestrictedSpaceName}}</td>
                    <td width="10%" rowspan="2">{{Form.RestrictedSpaceName}}</td>
                </tr>
                <tr>
                    <td>{{HighWorkSafetyPermit.JobLocation}}</td>
                    <td colspan="2">{{Form.JobLocation}}</td>
                    <td colspan="2"> <el-checkbox v-model="Form.contractor">{{HotWorkSafetyLicense.contractor}}</el-checkbox></td>
                </tr>
                <tr>
                    <td colspan="7" class="align_left">
                        {{PipelineOpenOperationSafetyLicense.WorkContent+mark.m}}<br />
                        {{Form.WorkContent}}
                    </td>
                </tr>
                <tr>
                    <td>{{GeneralLiftingWorkSafety.InvolvingOtherSpecialOperations}}</td>
                    <td colspan="6">
                        <el-checkbox-group v-model="Form.InvolvingOtherSpecialOperationsChecked">
                            <el-checkbox v-for="v in InvolvingOtherSpecialOperations" :label="v.value" :key="v.key">{{v.value}}</el-checkbox>
                        </el-checkbox-group>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        {{ConfinedSpace.IsNotSaftyCase}}
                        <template>
                            <el-radio v-model="Form.IsNotSaftyCase" label="1">是</el-radio>
                            <el-radio v-model="Form.IsNotSaftyCase" label="2">否</el-radio>
                        </template>
                    </td>
                    <td colspan="2">
                        {{HotWorkSafetyLicense.IsDrawing}}
                        <template>
                            <el-radio v-model="Form.IsDrawing" label="1">是</el-radio>
                            <el-radio v-model="Form.IsDrawing" label="2">否</el-radio>
                        </template>
                    </td>
                    <td colspan="3">
                        {{ConfinedSpace.IsNotEmergencyPlan}}
                        <template>
                            <el-radio v-model="Form.IsNotEmergencyPlan" label="1">是</el-radio>
                            <el-radio v-model="Form.IsNotEmergencyPlan" label="2">否</el-radio>
                        </template>
                    </td>
                </tr>
                <tr>
                    <td colspan="7">
                        <span style="width:50%; float:left; text-align:left;"> {{HotWorkSafetyLicense.GasDetector+mark.m}}{{Form.GasDetector}}</span>
                        <span style="width:50%;float:left;text-align:left;"> {{ConfinedSpace.TestingRequirements+mark.m}}{{Form.TestingRequirements}}</span>
                    </td>
                </tr>
            </table>
            <div style="height:auto;float:left;width:100%;">
                <div class="divTableBox divTableBoxLeft divTableTop" style="width:10%;border:1px solid;border-top:none;">
                    {{HotWorkSafetyLicense.JobType}}
                </div>


                <el-checkbox-group v-model="Form.JobTypeChceked" class="divTableBox divTableBoxRight divTableTop" style="width:90%;">
                    <ul>
                        <li v-for="v in JobTypes">
                            <el-checkbox :label="v.value" :key="v.key">
                                {{v.value}}
                            </el-checkbox>
                        </li>
                    </ul>
                </el-checkbox-group>


                <div class="divTableBox divTableBoxLeft divTableBottom" style="width:10%;border:1px solid;border-top:none;">
                    {{ConfinedSpace.MaybeRisk}}
                </div>
                <el-checkbox-group v-model="Form.MaybeRiskChceked" class="divTableBox divTableBoxRight divTableBottom" style="width:90%;">
                    <ul>
                        <li v-for="v in MaybeRisks">
                            <el-checkbox :label="v.value" :key="v.key">
                                {{v.value}}
                            </el-checkbox>
                        </li>
                    </ul>
                </el-checkbox-group>
            </div>

            <table cellpadding="0" cellspacing="0" style="border-top:none;">
                <tr>
                    <td colspan="7" class="align_left" style="border-right:none;">{{ConfinedSpace.GasTest}}</td>
                </tr>
                <tr>
                    <td>{{GasDetectionManagement.DetectionTime}}</td>
                    <td>{{GasDetectionManagement.DetectionPosition}}</td>
                    <td>{{GasDetectionManagement.OxygenConcentration}}</td>
                    <td>{{GasDetectionManagement.CombustibleGasConcentrationLEL}}</td>
                    <td>{{GasDetectionManagement.ToxicGasConcentration}}</td>
                    <td>{{GasDetectionManagement.TestConclusion}}</td>
                    <td>{{GasDetectionManagement.TesterSignature}}</td>
                </tr>
                <tr v-for="v in Form.GasTest">
                    <td>{{v.DetectionTime}}</td>
                    <td>{{v.DetectionPosition}}</td>
                    <td>{{v.OxygenConcentration}}</td>
                    <td>{{v.CombustibleGasConcentrationLEL}}</td>
                    <td>{{v.ToxicGasConcentration}}</td>
                    <td>{{v.TestConclusion}}</td>
                    <td>
                        <signature v-model="v.TesterSignature"></signature>
                    </td>
                </tr>
            </table>
            <table cellpadding="0" cellspacing="0" style="border-top:none;">
                <tr>
                    <td>{{SecurityAndRiskConfirmationCard.id}}</td>
                    <td colspan="4">{{BlindPlatePumpingSafety.SafetyMeasures}}</td>
                    <td>{{ConfinedSpace.Implementation}}</td>
                    <td>{{ConfinedSpace.ConfirmerSignature}}</td>
                </tr>
                <tr v-for="(v,i) in Form.SaftyMeasures">
                    <td>{{i+1}}</td>
                    <td colspan="4" class="align_left">
                        {{v.SaftyMeasures}}
                    </td>
                    <td> {{v.Implementation}}</td>
                    <td>
                        <signature v-model="v.ConfirmerSignature"></signature><!--{{v.ConfirmerSignature}}-->
                    </td>
                </tr>

                <!--基于数据库管控要求begin-->
                <!--<tr>
                    <td colspan="7" align="left">{{BlindPlatePumpingSafety.BasedDatabaseManagementRequirements}}</td>

                </tr>
                <tr>
                    <td>{{SecurityAndRiskConfirmationCard.id}}</td>
                    <td colspan="4">{{BlindPlatePumpingSafety.ControlRequirements}}</td>
                    <td>{{ConfinedSpace.Implementation}}</td>
                    <td>
                        {{ConfinedSpace.ConfirmerSignature}}
                    </td>
                </tr>
                <tr>
                    <td>1</td>
                    <td colspan="4" class="align_left">1.1、完善皮管捆扎合格标准；</td>
                    <td>已落实</td>
                    <td> <signature v-model="Form.RelatedPeople"></signature></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td colspan="4" class="align_left">
                        2.1、人员入职前进行三级教育<br />
                        2.2、入职后，每月车间主任组织一次安全考核、培训和安全例会，进行安全经验分享和知识分享；
                    </td>
                    <td>已落实</td>
                    <td><signature v-model="Form.RelatedPeople"></signature></td>
                </tr>-->
                <!--基于数据库管控要求end-->
                <tr>
                    <td>{{SecurityAndRiskConfirmationCard.id}}</td>
                    <td colspan="2">{{ConfinedSpace.UserName}}</td>
                    <td>{{ConfinedSpace.InConfinedSpaceTime}}</td>
                    <td>{{ConfinedSpace.OutConfinedSpaceTime}}</td>
                    <td>{{ConfinedSpace.ConfirmerSignature}}</td>
                    <td>{{ConfinedSpace.SignTime}}</td>
                </tr>
                <tr v-for="(v,i) in Form.BasedDatabaseManagementRequirements1">
                    <td>{{i+1}}</td>
                    <td colspan="2">{{v.UserName}}</td>
                    <td>{{v.InConfinedSpaceTime}}</td>
                    <td>{{v.OutConfinedSpaceTime}}</td>
                    <td><signature v-model="v.ConfirmerSignature"></signature></td>
                    <td>{{v.SignTime}}</td>
                </tr>
                <tr>
                    <td width="10%">{{SecurityAndRiskConfirmationCard.id}}</td>
                    <td width="10%">{{ConfinedSpace.MaterialName}}</td>
                    <td width="10%">{{ConfinedSpace.Count}}</td>
                    <td width="20%">{{ConfinedSpace.InConfinedSpaceTime}}</td>
                    <td width="20%">{{ConfinedSpace.OutConfinedSpaceTime}}</td>
                    <td width="15%">{{ConfinedSpace.ConfirmerSignature}}</td>
                    <td width="15%">{{ConfinedSpace.SignTime}}</td>
                </tr>
                <tr v-for="(v,i) in Form.BasedDatabaseManagementRequirements2">
                    <td>{{i+1}}</td>
                    <td>{{v.MaterialName}}</td>
                    <td>{{v.Count}}</td>
                    <td>{{v.InConfinedSpaceTime}}</td>
                    <td>{{v.OutConfinedSpaceTime}}</td>
                    <td><signature v-model="v.ConfirmerSignature"></signature></td>
                    <td>{{v.SignTime}}</td>
                </tr>
                <tr>
                    <td colspan="7" class="align_left">
                        本人确认收到许可证，了解作业对本单位的影响，将安排人员对此项工作给予关注和配合并和相关各方保持联系。<br />
                        {{HotWorkSafetyLicense.AffectedParties}}：<br />
                        <template v-for="v in Form.AffectedParties">
                            <span style="width:45%; float:left; text-align:left;height:40px;">
                                <signature v-model="v.name"></signature>
                            </span>
                            <span style="width:45%; float:left; text-align:left;height:40px;">
                                {{v.date}}
                            </span>
                        </template>

                    </td>

                </tr>
                <tr>
                    <td colspan="4" class="align_left">
                        我保证我及我的下属，已经了解本次作业的要求和此许可证的相关内容，并保证在作业开始前确认各项安全措施已落实，在作业过程中执行相关安全规定，在作业结束时及时通知属地单位负责人。<br />
                        {{JobLicenseManagement.JobManagerProple}}:<signature v-model="Form.JobManagerProple"></signature>
                    </td>
                    <td colspan="3" class="align_left">
                        本人已审核与本许可证相关的文件，并确认符合作业安全管理规定的要求，并对作业现场进行了检查, 确认安全措施已落实，同意进入受限空间作业。<br />
                        {{PipelineOpenOperationSafetyLicense.Approver}}：<signature v-model="Form.Approver">
                    </td>
                </tr>
                <tr>
                    <td colspan="7">{{ConfinedSpace.ConfirmationTicketsBeforeAssignment}}</td>

                </tr>
                <tr>
                    <td colspan="7" class="align_left">
                        本人在开始受限空间作业前，验证本作业许可证已获得批准。<br />
                        {{HighWorkSafetyPermit.Operator}}：<signature v-model="Form.Operator">
                            <br />
                            {{HighWorkSafetyPermit.Guardian}}：<signature v-model="Form.Guardian">
                    </td>

                </tr>
                <tr>
                    <td colspan="7" class="align_left">
                        我已确认，本次作业已全部结束，现场已得到妥善处理，本票证关闭。<br />
                        {{ScaffoldingChecklist.RelatedPeople}}：
                        <signature v-model="Form.RelatedPeople">
                    </td>

                </tr>
            </table>



            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="DialogTitle" fullscreen="true" :visible.sync="ListItem.dialogVisible" width="80%" height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">

        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    id: '123',
                    DialogTitle: '相关表格',
                    mydata: PersonInChargeTree,
                    ListItem: ListItem,
                    JobTypes: JobTypes,
                    MaybeRisks: MaybeRisks,
                    Form: {
                        JobManagerProple: '',//作业负责人
                        Approver: '',//审批人
                        Operator: '',//作业人
                        Guardian: '',//监护人
                        RelatedPeople: '',//作业负责人
                    },
                    rules: {},
                }
            },
            created: function () {

            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                getData: function () {
                    getData(this, '/api/ConfinedSpace/getMock?id=123');
                },
                DialogInput: function () {
                    //this.DialogTitle = "防护措施设置";
                    //DialogShow(this, 'tj', "ConfinedSpaceTable.html", this.id);

                    var mythis = this;
                    mythis.ListItem.InputUrl = "ConfinedSpaceTable.html?id=" + mythis.id + "&t=" + Date.parse(new Date()) + "&type=ck";
                    mythis.ListItem.dialogVisible = true;
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/ConfinedSpace/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
            },
            mounted: function () {

                this.getData();
                //===========调整divTable高度==============
                var h = 0;
                $(".divTableTop").each(function () {
                    if ($(this).height() > h)
                        h = $(this).height();
                })
                $(".divTableTop").height(h);
                $(".divTableTop").eq(0).css("line-height", h + 'px');
                var hh = 0;
                $(".divTableBottom").each(function () {
                    if ($(this).height() > hh)
                        hh = $(this).height();
                })
                $(".divTableBottom").height(hh);
                $(".divTableBottom").eq(0).css("line-height", hh + 'px');
                //自动填充li
                var licount = $(".divTableBoxRight ul li").length;
                if (licount % 5 > 0) {
                    for (var i = 0; i < 5 - (licount % 5); i++) {
                        $(".divTableBoxRight ul").append("<li>&nbsp;</li>")
                    }
                }
                //===========调整divTable高度==============

            }
        });
    </script>

</body>
</html> 